home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / pcxkit.zip / SHOW256.PAS < prev    next >
Pascal/Delphi Source File  |  1992-01-06  |  942b  |  36 lines

  1.  
  2. program SHOW256;
  3.  
  4. (* Sample implementation of PCX.TPU for 320x200x256-color files. Enter
  5.    a filename (without extension) on the command line or, if running under
  6.    Turbo, in the Parameters box. *)
  7.  
  8. uses
  9.   DOS,
  10.   CRT,
  11.   PCX;
  12.  
  13. var
  14.   blackpal : array[0..255] of RGBrec;
  15.  
  16.   (* -------------------------- SHOW256 --------------------------------- *)
  17.  
  18. BEGIN
  19.   pcxfilename := paramstr(1) + '.PCX';
  20.   setmode($13);                        (* Initialize graphics *)
  21.   fillchar(blackpal, 768, 0);          (* Set all colors to black *)
  22.   setregisters(blackpal);
  23.   read_pcx256(pcxfilename);            (* Put image into display memory *)
  24.   if file_error then
  25.     begin
  26.       setmode(3);
  27.       writeln('Can''t read that file.');
  28.       halt
  29.     end;
  30.   setregisters(RGB256);                (* Show true colors *)
  31.   repeat
  32.    until (readkey <> #1);
  33.   setmode(3)                           (* Restore text mode *)
  34. END.
  35.  
  36.